
import { BrowserRouter as Router,Routes,Route,Link,Outlet,useParams } from "react-router-dom";
import {BlogPosts} from "./Consts"

function Post(){
    const params = useParams();
    var post = BlogPosts["first-blog-post"];
    if(params.slug === "second-blog-post"){
        post = BlogPosts["second-blog-post"];
    }

    if(!post){
        return <span>The blog post you've requested doesn't exist.</span>;
    }
    const {title,description} = post;
    return (
        <div style={{ padding: 20 }}>
          <h3>{title}</h3>
          <p>{description}</p>
        </div>
      );
}

export default Post